package com.cl.mypureframe.util;

import android.annotation.SuppressLint;
import android.view.View;
import android.widget.Toast;

import com.cl.mypureframe.BaseApplication;


/**
 * @author zhuchaoxu
 */
public final class UtilToast {

	private static Toast T;
	
	private UtilToast() {}

	@SuppressLint("ShowToast")
	public static void show(Object object) {

		if (object != null) {

			if (T == null) {

				T = Toast.makeText(BaseApplication.INSTANCE, "", Toast.LENGTH_SHORT);

			}

			if (object instanceof CharSequence) {

				if (!object.equals("")) {

					T.setText((CharSequence) object);

					T.show();

				}

			} else if (object instanceof Integer) {

				T.setText((Integer) object);

				T.show();

			} else if (object instanceof View) {

				T.setView((View) object);

				T.show();

			}

		}

	}

}
